<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录后台 - 系统管理</title>
<link href="{IMG}Admin/Login.css" rel="stylesheet" type="text/css" />
<link  rel="stylesheet" type="text/css" href="{PUB}Dialog/skins/sharephp.css" />
<script type="text/javascript" src="{PUB}Scripts/Common/jquery-1.7.min.js"></script>
<script type="text/javascript" src="{PUB}Dialog/jquery.artDialog.min.js"></script>
<script type="text/javascript">
if (top.location != self.location){top.location=self.location; }
function msg(str) {
	$.dialog({
    	title: '提示',
		content : ''+str+'',
		time: 2000,
		button: [{
			value: '确定',
            callback: function () {
            },
            focus: true
		}]
	});
}
$(function(){
	$("#login_submit").click(function(){
		var user_name	= $("#user_name").val();
		var user_pwd	= $("#user_pwd").val();
		
		if ( user_name == "" ){
			msg('请填写用户名');
			return false;
		}
		if ( user_pwd == "" ){
			msg('请填写登录密码');
			return false;
		}
		var query = new Object();
		query.user_name		= user_name;
		query.user_pwd		= user_pwd;
		$("#loading").show();
		document.title='登录中...';
		$.ajax({
		 	url: "{:U('login/check')}",
		 	cache: false,
		 	type: "POST",
		 	data: query,
		 	dataType:"json",
		 	success:function(data){
			 	if ( data.status == 0 ){
					$("#loading").hide();
					msg(data.msg);
				 	//alert(data.msg);
					//window.location.reload();
				 	return false;
			 	} else {
				 	window.location.href="{:U('index')}";
				 	return false;
			 	}
			},error:function(a,b,c){
		 		if(a.responseText)
					alert(a.responseText);
			}
		});
	});
})
</script>
</head>

<body>
<div class="login">
  <div class="logo"> <a href="http://www.itye.cn/" target="_blank"> <img src="{IMG}Admin/logo_login.gif" alt="后台管理系统" /> <br />
    www.itye.cn </a> </div>
  <div class="info">
    <h1 style="height:24px;"></h1>
    <div>
      <form method="post" action="{:U('login/check')}">
        <p>管理员Email<br />
          <input class="input_1" name="user_name" id="user_name" maxlength="50" value='' />
        </p>
        <p>密码<br />
          <input class="input_1" type="password" id="user_pwd" name="pwd" maxlength="50" value='' />
        </p>
        <input class="submit" type="button" id="login_submit" value="登录后台" />
        <a href="index.php">返回首页</a>
      </form>
    </div>
  </div>
</div>
<div class="loading" id="loading"></div>
</body>
</html>